package com.suredy.app.porject.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.suredy.app.porject.constants.ContractOpLogType;
import com.suredy.core.model.BaseModel;

/**
 * 合同信息操作日志
 * 
 * @author VIVID.G
 * @since 2015-11-11
 * @version v0.1
 */
@Entity
@Table(name = "tb_contract_op_log")
public class ContractOpLog extends BaseModel {

	private static final long serialVersionUID = 1L;

	/* 操作时间 */
	@Column(nullable = false)
	private Date time;

	/* 操作内容 */
	@Column(length = 200, nullable = false)
	@Enumerated(EnumType.STRING)
	private ContractOpLogType op;

	/* 操作员 */
	@Column(length = 50, nullable = false)
	private String oper;

	/* 备注 */
	@Column(length = 3000)
	private String remark;

	/* 关联的招标信息 */
	@JsonIgnore
	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinColumn(name = "contract_id")
	private Contract contract;

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public ContractOpLogType getOp() {
		return op;
	}

	public void setOp(ContractOpLogType op) {
		this.op = op;
	}

	public String getOper() {
		return oper;
	}

	public void setOper(String oper) {
		this.oper = oper;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Contract getContract() {
		return contract;
	}

	public void setContract(Contract contract) {
		this.contract = contract;
	}

}
